package Json;

import com.google.gson.Gson;

/**
 * 实体缺少字段
 * @author zybw-kf01 2018-5-8 
 *
 */
public class ClassLessField {

	public static void main(String[] args) {
		String str = "{\"name\":\"jie\",\"age\":22}";
		Gson gson = new Gson();
		
		ClassLessFieldDemo fromJson = gson.fromJson(str,ClassLessFieldDemo.class);
		System.out.println(fromJson.name);
//		System.out.println(fromJson.age);
	}
	
	
}

class ClassLessFieldDemo{
	String name;
//	int age;
	
	
}
